package com.example.demo.niuke;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @Author: liull
 * @Description: 求最小公倍数 将较大的数依次扩大2 3 4倍 直到出现第一个较小的数倍数的数 就是我们要找的最小公倍数
 * @Date: Created in 14:42 2020/3/24
 * @Modified By:
 */
public class Main20 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        String[] array = line.split(" ");
        int num1 = Integer.parseInt(array[0]);
        int num2 = Integer.parseInt(array[1]);
        int max = Math.max(num1, num2);
        int min = Math.min(num1, num2);
        int res = gbs(max, min); //最小公倍数
        int ret = gys(max, min);
        System.out.println(ret);
        //        System.out.println(res);
    }

    /**
     * 最小公倍数
     *
     * @param max
     * @param min
     * @return
     */
    private static int gbs(int max, int min) {
        int temp;
        for (int i = 1; ; i++) {
            temp = max * i;
            if (temp % min == 0) {
                return temp;
            }
        }
    }

    /**
     * 最大公约数
     *
     * @param max
     * @param min
     * @return
     */
    private static int gys(int max, int min) {
        while (min != 0) {
            int temp = max % min;
            max = min;
            min = temp;
        }
        return min;
    }
}
